import Tabs from './Tabs.vue'

Tabs.install = function (Vue, options) {
  Vue.prototype.$createTabs = function () {
    Vue.prototype.$openTabs = this.openTabs // 映射打开标签方法到原型
    Vue.prototype.$activeTab = this.tabsActive // 当前激活页签
    Vue.prototype.$tabRemove = this.tabRemove // 关闭页签方法
    Vue.prototype.$keepAliveList = this.keepAliveList

    Vue.prototype.$setActiveTab = function (nowTab) {
      Vue.prototype.$activeTab = nowTab
      Vue.prototype.$tabParams = this.tabsParams[nowTab] // 当前页签的参数
    }
  }

  const { tabMaps } = options
  Tabs.components = tabMaps
  Vue.component('tabs-router', Tabs)
}

export default Tabs
